home *** CD-ROM | disk | FTP | other *** search
/ SGI Freeware 1999 August / SGI Freeware 1999 August.iso / dist / fw_libxml.idb / usr / freeware / include / gnome-xml / entities.h.z / entities.h
Encoding:
C/C++ Source or Header  |  1999-07-16  |  2.5 KB  |  82 lines

  1. /*
  2.  * entities.h : interface for the XML entities handking
  3.  *
  4.  * See Copyright for the status of this software.
  5.  *
  6.  * Daniel.Veillard@w3.org
  7.  */
  8.  
  9. #ifndef __XML_ENTITIES_H__
  10. #define __XML_ENTITIES_H__
  11.  
  12. #include "tree.h"
  13.  
  14. #ifdef __cplusplus
  15. extern "C" {
  16. #endif
  17.  
  18. #define XML_INTERNAL_GENERAL_ENTITY        1
  19. #define XML_EXTERNAL_GENERAL_PARSED_ENTITY    2
  20. #define XML_EXTERNAL_GENERAL_UNPARSED_ENTITY    3
  21. #define XML_INTERNAL_PARAMETER_ENTITY        4
  22. #define XML_EXTERNAL_PARAMETER_ENTITY        5
  23. #define XML_INTERNAL_PREDEFINED_ENTITY        6
  24.  
  25. /*
  26.  * An unit of storage for an entity, contains the string, the value
  27.  * and the linkind data needed for the linking in the hash table.
  28.  */
  29.  
  30. typedef struct xmlEntity {
  31.     int type;            /* The entity type */
  32.     int len;            /* The lenght of the name */
  33.     const CHAR    *name;    /* Name of the entity */
  34.     const CHAR    *ExternalID;    /* External identifier for PUBLIC Entity */
  35.     const CHAR    *SystemID;    /* URI for a SYSTEM or PUBLIC Entity */
  36.     CHAR *content;        /* The entity content or ndata if unparsed */
  37.     CHAR *orig;            /* The entity cont without ref substitution */
  38. } xmlEntity;
  39. typedef xmlEntity *xmlEntityPtr;
  40.  
  41. /*
  42.  * ALl entities are stored in a table there is one table per DTD
  43.  * and one extra per document.
  44.  */
  45.  
  46. #define XML_MIN_ENTITIES_TABLE    32
  47.  
  48. typedef struct xmlEntitiesTable {
  49.     int nb_entities;        /* number of elements stored */
  50.     int max_entities;        /* maximum number of elements */
  51.     xmlEntityPtr table;            /* the table of entities */
  52. } xmlEntitiesTable;
  53. typedef xmlEntitiesTable *xmlEntitiesTablePtr;
  54.  
  55.  
  56. /*
  57.  * External functions :
  58.  */
  59.  
  60. #include "parser.h"
  61.  
  62. void xmlAddDocEntity(xmlDocPtr doc, const CHAR *name, int type,
  63.               const CHAR *ExternalID, const CHAR *SystemID, CHAR *content);
  64. void xmlAddDtdEntity(xmlDocPtr doc, const CHAR *name, int type,
  65.               const CHAR *ExternalID, const CHAR *SystemID, CHAR *content);
  66. xmlEntityPtr xmlGetPredefinedEntity(const CHAR *name);
  67. xmlEntityPtr xmlGetDocEntity(xmlDocPtr doc, const CHAR *name);
  68. xmlEntityPtr xmlGetDtdEntity(xmlDocPtr doc, const CHAR *name);
  69. const CHAR *xmlEncodeEntities(xmlDocPtr doc, const CHAR *input);
  70. CHAR *xmlEncodeEntitiesReentrant(xmlDocPtr doc, const CHAR *input);
  71. xmlEntitiesTablePtr xmlCreateEntitiesTable(void);
  72. xmlEntitiesTablePtr xmlCopyEntitiesTable(xmlEntitiesTablePtr table);
  73. void xmlFreeEntitiesTable(xmlEntitiesTablePtr table);
  74. void xmlDumpEntitiesTable(xmlBufferPtr buf, xmlEntitiesTablePtr table);
  75. xmlEntitiesTablePtr xmlCopyEntitiesTable(xmlEntitiesTablePtr table);
  76.  
  77. #ifdef __cplusplus
  78. }
  79. #endif
  80.  
  81. # endif /* __XML_ENTITIES_H__ */
  82.